#ifndef _PROTOL_IOT_H
#define _PROTOL_IOT_H

#include "sc95f.h"

#define DEVICE_TYPE 0x01
#define DEVICE_MODEL 0x01

#define COMMAND_SYS_DEVICE_REQUEST 0x10
#define COMMAND_SYS_DEVICE_SN 0x11
#define COMMAND_SYS_WIFI_STATE 0x12
#define COMMAND_SYS_LOCAL_TIME 0x13
#define COMMAND_SYS_WIFI_SIGNAL 0x14
#define COMMAND_SYS_WIFI_MAC 0x15

#define CMOMMAND_DEVICE_DATA 0x01
#define CMOMMAND_DEVICE_STATE 0x02
#define CMOMMAND_DEVICE_CONTROL 0x03
#define CMOMMAND_DEVICE_ABNOR 0x04

typedef struct
{
	uint8_t year;
	uint8_t month;
	uint8_t day;
	uint8_t hour;
	uint8_t minute;
}IOT_TIME;

uint8_t iot_protol_parse(char* Buf);
uint8_t iot_protol_send(void);


uint8_t iot_device_data_pack(void);
uint8_t iot_device_state_pack(void);
uint8_t iot_device_control_pack(void);
uint8_t iot_device_abnor_pack(void);
uint8_t iot_sys_device_request_pack(uint8_t buf);
uint8_t iot_sys_device_sn_pack(void);
uint8_t iot_sys_wifi_state_pack(void);
uint8_t iot_sys_local_time_pack(void);
uint8_t iot_sys_wifi_signal_pack(void);
uint8_t iot_sys_wifi_mac_pack(void);

#endif